hysop.core.mpi.bridge module

Tools to compute the intersection between two topologies.

`.. currentmodule : hysop.core.mpi.bridge

  • Bridge for topologies/operators defined inside the same mpi communicator

  • BridgeInter

  • BridgeOverlap for topologies defined inside the same mpi parent communicator and with a different number of processes

class hysop.core.mpi.bridge.Bridge(source, target, dtype, order)[source]

Bases: object

Intersection between two topologies.

Intersection between two topologies. See users’ manual for details

Parameters:
  • source (CartesianTopology) – topologies that own the source mesh and targeted mesh

  • target (CartesianTopology) – topologies that own the source mesh and targeted mesh

  • dtype – numpy dtype to be send and received

  • order – memory order of arrays to be send/recieved

has_local_inter()[source]

True if local mesh points are also present on remote mesh

local_source_ind()[source]

indices of points (in the local mesh) that also belong to remote mesh

local_target_ind()[source]

indices of points (in the remote mesh) that also belong to the local mesh

recv_types()[source]

Returns the dictionnary of MPI derived types received on targeted topology.

send_types()[source]

Returns the dictionnary of MPI derived types sent by source topology.

class hysop.core.mpi.bridge.BridgeInter(current, source_id, target_id, dtype, order)[source]

Bases: object

Intersection between two topologies defined on two different mpi communicators.

Intersection between two topologies defined on different mpi communicators (i.e. implies mpi intercomm) See users’ manual for details

Parameters:
  • current (CartesianTopology)

  • source_id (int) – mpi task ids for the source/target. Required if source/target is None else infered from source/target.

  • target_id (int) – mpi task ids for the source/target. Required if source/target is None else infered from source/target.

  • dtype – numpy dtype to be send and received

  • order – memory order of arrays to be send/recieved

transfer_indices(task_id=None)[source]

Return the dictionnary of transfer local indices used for send (if on source) or receive (if on target)

transfer_types(task_id=None)[source]

Return the dictionnary of MPI derived types used for send (if on source) or receive (if on target)

class hysop.core.mpi.bridge.BridgeOverlap(source_id, target_id, comm_ref=None, **kwds)[source]

Bases: Bridge

Bridge between two topologies that: - have a different number of mpi processes - have common mpi processes

i.e. something in between a standard bridge with intra-comm and a bridge dealing with intercommunication.

The main difference with a standard bridge is that this one may be call on processes where either source or target does not exist.

Bridge between two topologies that: * have a different number of mpi processes * have common mpi processes

Parameters:

comm_ref (MPI.COMM) – mpi communicator used for all global communications. It must include all processes of source and target. If None, source.parent is used.

Notes

this is something in between a standard bridge with intra-comm and a bridge dealing with intercommunication. This is probably a very pathologic case …

The main difference with a standard bridge is that this one may be call on processes where either source or target does not exist.

transfer_indices(task_id=None)[source]

Return the dictionnary of local indices used for send (if task_id is source) or receive (if task_id is target)

transfer_types(task_id=None)[source]

Return the dictionnary of MPI derived types used for send (if task_id is source) or receive (if task_id is target)